home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / TextHarvest / TextHarvest-Install.exe / {app} / ScriptSample02.txt < prev    next >
Text File  |  2004-12-01  |  3KB  |  59 lines

  1. ;---------------------------------------------------------------------------
  2. ; Sample Parse-O-Matic Script for TextHarvest
  3. ;---------------------------------------------------------------------------
  4. ;
  5. ;   This script is nearly identical to ScriptSample01.txt but it
  6. ;   uses a counter to ensure that a maximum of 5 lines of data are
  7. ;   sent to the output file.
  8. ;
  9. ;---------------------------------------------------------------------------
  10. ; Check settings. Please see the script file ScriptSample01.txt if you do
  11. ; not understand how this section works; the techniques are explained there.
  12. ;---------------------------------------------------------------------------
  13. Begin FirstRun = ''
  14.   FirstRun = 'N'
  15.   InputFileWanted = 'ThingsToDo.txt'
  16.   X = Len $OptionX $OptionY $OptionZ
  17.   Begin X <> 0
  18.     M1 = 'Please clear the /Keep /Delete and' $0A$0D
  19.     M2 = '/Control input boxes and try this'  $0A$0D
  20.     M3 = 'this script again.'
  21.     Stop M1 M2 M3
  22.   End
  23.   Begin $ActualIFN ~ InputFileWanted
  24.     M1 = 'Please try this script with the' $0A$0D
  25.     M2 = 'input file ' InputFileWanted
  26.     Stop M1 M2
  27.   End
  28.   ;
  29.   ;   If all is well, we'll output a nice header
  30.   ;
  31.   SepLine = Padded '' 80 'Left' '-'       ; Make a line of 80 dashes
  32.   OutEnd SepLine
  33.   OutEnd 'Five lines from ' $ActualIFN
  34.   OutEnd SepLine
  35. End
  36.  
  37. ;---------------------------------------------------------------------------
  38. ; Get the data
  39. ;---------------------------------------------------------------------------
  40. Category    = $OutData[1 9]                 ; Get category
  41. Description = $OutData[10 999]              ; Get description
  42. TrimChar Category                           ; Remove left & right spaces
  43. Category = ChangeCase Category 'Hardcaps'   ; Capitalize The Text
  44.  
  45. ;---------------------------------------------------------------------------
  46. ; Send to output file
  47. ;---------------------------------------------------------------------------
  48. Output '"' Category '",'
  49. OutEnd '"' Description '"'
  50. Cntr = Cntr+                                ; Add 1 (one) to counter
  51.  
  52. ;---------------------------------------------------------------------------
  53. ; Here we will use the Stop command without any parameters.  If you gave
  54. ; it a message (e.g. Stop 'Finished') the message would appear in a
  55. ; pop-up window when the Stop command was triggered.  (This gives you
  56. ; an attention-getting way to report errors in the data.)
  57. ;---------------------------------------------------------------------------
  58. if Cntr = 5 Stop                            ; Stop when we reach 5
  59.